﻿
<%@ Page Language="C#"  MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true"  CodeFile="Afi.aspx.cs" Inherits="Afi" Title="Afi List" %>

<asp:Content ID="Content2" ContentPlaceHolderID="TitleContent" Runat="Server">Afi List</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentContent" Runat="Server">
		<data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1" PersistenceMethod="Session" />
		<br />
		<data:EntityGridView ID="GridView1" runat="server"			
				AutoGenerateColumns="False"					
				OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
				DataSourceID="AfiDataSource"
				DataKeyNames="AfiCode"
				AllowMultiColumnSorting="false"
				DefaultSortColumnName="" 
				DefaultSortDirection="Ascending"	
				ExcelExportFileName="Export_Afi.xls"  		
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" ShowEditButton="True" />				
				<asp:BoundField DataField="AfiCode" HeaderText="Afi Code" SortExpression="[AFICode]" ReadOnly="True" />
				<asp:BoundField DataField="ClientName" HeaderText="Client Name" SortExpression="[ClientName]"  />
				<asp:BoundField DataField="ClientAddress1" HeaderText="Client Address1" SortExpression="[ClientAddress1]"  />
				<asp:BoundField DataField="ClientAddress2" HeaderText="Client Address2" SortExpression="[ClientAddress2]"  />
				<asp:BoundField DataField="ClientAddress3" HeaderText="Client Address3" SortExpression="[ClientAddress3]"  />
				<asp:BoundField DataField="ClientTaxCode" HeaderText="Client Tax Code" SortExpression="[ClientTaxCode]"  />
				<data:HyperLinkField HeaderText="Created By" DataNavigateUrlFormatString="WebUserEdit.aspx?UserId={0}" DataNavigateUrlFields="UserId" DataContainer="CreatedBySource" DataTextField="Name" />
				<asp:BoundField DataField="CreatedDate" DataFormatString="{0:d}" HtmlEncode="False" HeaderText="Created Date" SortExpression="[CreatedDate]"  />
				<asp:BoundField DataField="Currency" HeaderText="Currency" SortExpression="[Currency]"  />
				<asp:BoundField DataField="Status" HeaderText="Status" SortExpression="[Status]"  />
				<asp:BoundField DataField="Pam" HeaderText="Pam" SortExpression="[PAM]"  />
			</Columns>
			<EmptyDataTemplate>
				<b>No Afi Found!</b>
			</EmptyDataTemplate>
		</data:EntityGridView>
		<br />
		<asp:Button runat="server" ID="btnAfi" OnClientClick="javascript:location.href='AfiEdit.aspx'; return false;" Text="Add New"></asp:Button>
		<data:AfiDataSource ID="AfiDataSource" runat="server"
			SelectMethod="GetPaged"
			EnablePaging="True"
			EnableSorting="True"
			EnableDeepLoad="True"
			>
			<DeepLoadProperties Method="IncludeChildren" Recursive="False">
	            <Types>
					<data:AfiProperty Name="WebUser"/> 
					<%--<data:AfiProperty Name="AttachmentCollection" />--%>
					<%--<data:AfiProperty Name="AfiDetailCollection" />--%>
				</Types>
			</DeepLoadProperties>
			<Parameters>
				<data:CustomParameter Name="WhereClause" Value="" ConvertEmptyStringToNull="false" />
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" />
				<asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex" Type="Int32" />
				<asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize" Type="Int32" />
				<data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
			</Parameters>
		</data:AfiDataSource>
	    		
</asp:Content>



